package service.impl;

import dao.WjMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Wj;
import service.WjService;

import java.util.List;

/**
 * 问卷表业务逻辑实现类
 */
@Service
public class WjServiceImpl implements WjService {
    @Autowired
    private WjMapper wjMapper;

    @Override
    public Wj findWjById(Integer id) {
        return wjMapper.findWjById(id);
    }

    @Override
    public List<Wj> findAllWj() {
        return wjMapper.findAllWj();
    }

    @Override
    public int addWj(Wj wj) {
        // 不设置createTime，使用数据库默认值
        return wjMapper.addWj(wj);
    }

    @Override
    public int updateWj(Wj wj) {
        return wjMapper.updateWj(wj);
    }

    @Override
    public int deleteWj(Integer id) {
        return wjMapper.deleteWj(id);
    }
}